-
Notifications
You must be signed in to change notification settings - Fork 56
feat: expose prefer-cache to create_device_manager caller #719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR exposes the prefer_cache parameter to callers of the create_device_manager function, allowing them to control whether cached device data should be preferred over fetching fresh data from the API.
- Added
prefer_cacheparameter tocreate_device_managerfunction signature with default value ofTrue - Updated function docstring to document the new parameter
- Parameter is passed through to the internal
discover_devicescall
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
allenporter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way we can do this is just clear the home data cache before calling into the integration. WDYT?
We don't want the cache cleared though right? as if we fail the home data call, we want to still try to setup |
allenporter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sounds good.
It definitely makes the cache less helpful though. As we can get into a unfortunate situation where on startup we do a bunch of home data calls when theoretically the part that is stopping it from setting up is not the home data. But for now, it probably makes sense as is so users don't have to do anything crazy to get their new devices added. |
No description provided.